Home:ALL Converter>How to send http request in a timely basis and keep updated data in My Angular/ ionic components

How to send http request in a timely basis and keep updated data in My Angular/ ionic components

Ask Time:2021-01-26T14:03:21         Author:Santosh Gonzalez

Json Formatter

I have a simple driver ionic/angular application that needs to regularly retrieve latest bookings updates from a server.

The server have no SignalR or similar technology implemented, so I have to make an http request to fetch the data from the server ever 10 second ...

I also have to have a central ionic/angular service that have a local variable which holds a updated version of the bookings (every 10 second). Let's call it UpdateBookings of type booking[]

other pages like bookings-list and booking-details, must be notified every time there is a change in the data in the variable UpdateBookings.

Maybe via an RxJs observable, subject or BehaviorSubject ...

What is the best way to implement such scenario?

Author:Santosh Gonzalez,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/65896590/how-to-send-http-request-in-a-timely-basis-and-keep-updated-data-in-my-angular
yy